<template>
	<view style="background-color: #f7f7f7;">
		<!-- 顶部蓝色背景 -->
		<view class="topimage">
			<!-- 顶部栏 -->
			<view class="title">
				<image src="../../../static/车联网服务-08我的-05我的车辆添加_slices/箭头.png" @click="back"></image>
				<view style="margin-left: 250rpx;">团购优惠</view>
			</view>
		</view>
		<!-- 主体部分 -->
		<view class="top">
		<!-- 循环 -->
		<navigator  url="/packageFuelUp/pages/tuangou/tuangou" class="topZhuti" v-for="(item,index) in youHuiList" :key="index">
			<!-- 图片部分 -->
			<!-- <view><image class="image1" :src="item.activity_photo"></image></view> -->
			<view><image class="image1" src="/static/wddd/奔驰.jpg"></image></view>
			<!-- 文字部分 -->
			<view class="text">
				<!-- <view class="text1">{{item.title}}</view> -->
				<view class="text1">汽车惠民活动走进...</view>
				<view class="text2" type="button"  @click="goToTuanGou(item.activity_id)">详情<image class="jiantou" src="../../../static/车联网服务-07优惠团购_slices/右箭头_17.png"></image></view>
			</view>
		</navigator>	
		</view>
	</view>
</template>

<script>
	import request from '@/utils/api.js'
	export default {
		data() {
			return {
				youHuiList:[]
				
			}
		},
		methods: {
			async SelectList(){
				const res = await request({
					url:"/promotion/selectList"
				})
				this.youHuiList = res;
				// console.log("赋值",this.youHuiList);
			},
			goToTuanGou(activityId){
				console.log(activityId);
				uni.navigateTo({
					url:`/pages/tuanGouYouHui-07-01_17/tuanGouYouHui-07-01_17?activityId=`+activityId,
				})
			},  
			back() {
				uni.navigateBack({
					data: 1
				})
			  }
		  },
		
		  onLoad(){
			  this.SelectList();
		  },
		   onShow() {
		  		// console.log(this.youHuiList); //打印数据结构
		  	}
	}
</script>

<style lang="scss">
	.title {
		
		background-repeat: no-repeat;
		background-size: 100% 100%;
		height: 300rpx;
		display: flex;
		padding: 60rpx 300rpx 40rpx 30rpx;
		justify-content: space-between;
	
		image {
			color: white;
			width: 35rpx;
			height: 35rpx;
		}
	
		view {
			color: white;
		}
	}
	
	
	.topimage{
		display: flex;
		width: 100%;
		height: 430rpx;
		background-color: #3183fc;
	}
	// .topLan{
	// 	width: 100%;
	// 	display: flex;
	// 	position: absolute;
	// 	top: 60rpx;
	// 	justify-content: center;
	// 	align-items: center;
	// }
	// .left{
	// 	position: absolute;
	// 	left: 10rpx;	
	// }
	.top{
		margin-top: -280rpx;
	}
	.topZhuti{
		background-color: white;
		width: 94%;
		margin: 0 auto;
		text-align: center;
		border-radius: 10px;
		padding-bottom: 16rpx;
		margin-bottom: 20rpx;
	}
	.image1{
		margin-top: 30rpx;
		width: 92%;
		height: 394rpx;
		border-radius: 10px;
	}
	.text{
		width: 92%;
		display: flex;
		margin: 22rpx auto;
		justify-content: space-between;
	}
	.text1{
		font-size: 14px;
	}
	.text2{
		padding-right: 20rpx;
		font-size: 11px;
		display: flex;
		align-items: center;
		color: #a2a2a2;
	}
	.jiantou{
		width: 24rpx;
		height: 24rpx;
	}
</style>
